﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Bam.Lib.Screens
{
    class MenuScreen: GameScreen
    {
        protected String title = "";
        protected StringMenu menu = new StringMenu();
        public SpriteFont title_font = null;
        public Texture2D title_img = null;
        public MenuScreen()
        {
            menu = new StringMenu();
            menu.position = new Vector2(300.0f, 300.0f);
        }
        public override void LoadContent()
        {
            title_img = this.ScreenManager.Game.Content.Load<Texture2D>(@"images\Seizure-Ball-Menuscreen-Header");
            title_font = this.ScreenManager.Game.Content.Load<SpriteFont>(@"fonts\swinkydad");
            menu.loadContent(this.ScreenManager.Game);
        }

        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            menu.update(gameTime);
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }

        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin();
            ScreenManager.SpriteBatch.Draw(title_img, new Vector2(0.0f, 0.0f), Color.White);
            menu.draw(ScreenManager.SpriteBatch);

            ScreenManager.SpriteBatch.DrawString(title_font, title, new Vector2(750.0f, 100.0f), Color.White);
            base.Draw(gameTime);
            ScreenManager.SpriteBatch.End();
        }

        public override void HandleInput(InputManager input)
        {
            if (input.isKeyPressed(Keys.Escape))
                ScreenManager.Game.Exit();
            menu.handleInput(input, this.ScreenManager);
            base.HandleInput(input);

        }
    }
}
